import numba
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn import datasets
import numpy as np
from KNN import KNN

digits = datasets.load_digits()
print(digits.data.shape)
print(digits.target.shape)

x = digits.data
y = digits.target

X_train, X_train_test, y_train, y_train_test = train_test_split(x, y)

knn = KNN(6)
knn.fit(X_train, y_train)
predict = knn.predict(X_train_test)

print(np.sum(predict == y_train_test) / len(X_train_test))
